function viewArc(aid){
	if(aid==0) aid = getOneItem();
	window.open("archives.asp?aid="+aid+"&action=viewArchives");
}
function editArc(aid){
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=editArchives";
}
function updateArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=makeArchives&qstr="+qstr+"";
}
function checkArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=checkArchives&qstr="+qstr+"";
}
function moveArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=moveArchives&qstr="+qstr+"";
}
function adArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=commendArchives&qstr="+qstr+"";
}
function delArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=delArchives&qstr="+qstr+"";
}

//获得选中文件的文件名
function getCheckboxItem()
{
	var allSel="";
	if(document.forms[0].id.value) return document.forms[0].id.value;
	for(i=0;i<document.forms[0].id.length;i++)
	{
		if(document.forms[0].id[i].checked)
		{
			if(allSel=="")
				allSel=document.forms[0].id[i].value;
			else
				allSel=allSel+"`"+document.forms[0].id[i].value;
		}
	}
	return allSel;
}

//获得选中其中一个的id
function getOneItem()
{
	var allSel="";
	if(document.forms[0].id.value) return document.forms[0].id.value;
	for(i=0;i<document.forms[0].id.length;i++)
	{
		if(document.forms[0].id[i].checked)
		{
				allSel = document.forms[0].id[i].value;
				break;
		}
	}
	return allSel;
}
function selAll()
{
	var ids = document.getElementsByName("id");
	for(var i = 0; i < ids.length; i++)
	{
		if(!ids[i].checked)
		{
			ids[i].checked = true;
		}
	}
}
function noSelAll()
{
	var ids = document.getElementsByName("id");
	for(var i=0; i < ids.length; i++)
	{
		if(ids[i].checked)
		{
			ids[i].checked = false;
		}
	}
}

/**=================自定义数组函数=============================*/
/**
 * 数组最大元素 
 */
function array_max()
{
	var max = this[0];
	for(var i = 1; i < this.length; i++)
	{		
		if(max < this[i])
		{
			max = this[i];
		}
	}
	return max;
}
 Array.prototype.max = array_max;
 
/**
 * 数组最小元素
 */
 function array_min()
 {
 	var min = this[0];
 	for(var i = 1; i < this.length; i++)
 	{
 		if(min > this[i])
 		{
 			min = this[i];
 		}
 	}
 	return min;
 }
 Array.prototype.min = array_min; 
 /**==============================================*/